package com.gjy.design.composite.f;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-11-11 10:59:14
 */
public class Demo {

    public static void main(String[] args) {
        FileSystemComponent root = new Directory("根目录");
        FileSystemComponent dir1 = new Directory("文档");
        FileSystemComponent file1 = new File("README.md");
        FileSystemComponent file2 = new File("config.xml");

        root.add(dir1);
        root.add(file2);
        dir1.add(file1);

        root.display();
    }

}
